package com.avcdata

import org.apache.spark.{SparkConf, SparkContext}
import org.apache.spark.sql.hive.HiveContext

object hive {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setAppName("test").setMaster("local[2]")
    val sc = new SparkContext(conf)
    val sqlContext = new HiveContext(sc)
    val rows = sqlContext.sql("SELECT count(name) FROM psn1")
    rows.foreach(row => println(row))
  }
}
